home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2000 #1 / Amiga Plus CD - 2000 - No. 1.iso / Tools / Text / Edit / GoldED-Demo / installdata / golded / developer / api / examples / timer / defs.h next >
Encoding:
C/C++ Source or Header  |  1999-12-03  |  1.5 KB  |  46 lines

  1. #include <exec/types.h>
  2. #include <exec/ports.h>
  3. #include <exec/semaphores.h>
  4. #include <exec/libraries.h>
  5. #include <dos/dos.h>
  6. #include <exec/memory.h>
  7. #include <clib/exec_protos.h>
  8. #include <clib/alib_protos.h>
  9. #include <clib/dos_protos.h>
  10. #include <clib/intuition_protos.h>
  11. #include <devices/timer.h>
  12. #include <string.h>
  13.  
  14. #define LibCall    __geta4 __regargs
  15. #define Prototype  extern
  16.  
  17. #include "golded:developer/api/include/apilib.h"
  18. #include "o/lib-protos.h"
  19.  
  20. extern const char LibName[];
  21. extern const char LibId[];
  22.  
  23. /* we allocate a context structure for each host process (because message ports work on a per-task basis) */
  24.  
  25. struct HostContext {
  26.  
  27.     struct Node         Node;                        /* it's a linked list */
  28.     struct Task        *Task;                        /* host task */
  29.     struct MsgPort     *TimerPort;                   /* port for receiving timer messages */
  30.     struct timerequest *TimeRequest;                 /* device handle */
  31.     struct timerequest *IOPending;                   /* pending IO request */
  32.     UWORD               OpenCount;                   /* open counter (number of plug-in instances used by this host) */
  33. };
  34.  
  35. /* we allocate a PlugInContext for each plug-in instance */
  36.  
  37. struct PlugInContext {
  38.  
  39.     struct APIClient    APIClient;                   /* API handle (exposed to host) */
  40.     struct HostContext *HostContext;                 /* host context for this instance */
  41. };
  42.  
  43. /* globals */
  44.  
  45. extern struct List HostList;                         /* list of hosts using this plug-in */
  46.